<?php

// no direct access
defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.view');

/**
 * HTML View class for the View
 */
class TaxiBookingViewConfirm extends JView
{

    /**
     * Creates the Forms for the View
     *
     * @since 1.0
     */
    function display($tpl = null)
    {

        $app = JFactory::getApplication();
        //initialize variables
        $document = & JFactory::getDocument();
        $menus = $app->getMenu();
        $lang = & JFactory::getLanguage();
        
        $menu = $menus->getActive();
        $uri = & JFactory::getURI();
        $session = & JFactory::getSession();
        $elsettings = & booking_helper::config();


        if ($session->get('price', 0) == 0)
        {
            $app->redirect(JRoute::_('index.php?option=com_taxibooking', false), 'No route found! please check your Destinations.');
        }

        // Get the page/component configuration
        $params = $app->getParams();

        //add css file
        $this->document->addStyleSheet($this->baseurl . '/components/com_taxibooking/assets/css/booking.css');

        // right from the menu item itself
        if (is_object($menu))
        {

            $menu_params = new JRegistry;
            $menu_params->loadString($menu->params);

            if (!$menu_params->get('page_title'))
            {

                $params->set('page_title', JText::_('Taxi Booking'));
            }
        }
        else
        {
            $params->set('page_title', JText::_('Taxi Booking'));
        }

        /*
         * Handle the metadata for the categories list
         */
        $this->document->setTitle($title);
        $this->document->setMetadata('keywords', $params->get('page_title'));

        if ($app->getCfg('MetaTitle') == '1')
        {
            $this->document->setMetadata('title', $params->get('page_title'));
        }

        $from_dest = $session->get('from_dest', -1);
        $to_dest = $session->get('to_dest', -1);
        $begin = $session->get('begin', '');
        $end = $session->get('end', '');

        $lat_long_from = $session->get('lat_long_from', array());
        $lat_long_to = $session->get('lat_long_to', array());
        $dist_miles = $session->get('dist_miles', 0);
        $price = $session->get('price', 0);
        $formatted_price = $session->get('formatted_price', 0);
        $returnjurney = $session->get('returnjurney', 0);
        $vehicletype = $session->get('vehicle', -1);
        $selpsg = $session->get('passengers', 0);
        $suitcases = $session->get('suitcases', 0);
        $infantseats = $session->get('infantseats', 0);
        $chseats = $session->get('chseats', 0);
        $boosterseats = $session->get('boosterseats', 0);
        $selcarry = 0;

//                echo ' success redirect';
        $this->assign('action', $uri->toString());

        $this->assignRef('elsettings', $elsettings);
        $this->assignRef('begin', $begin);
        $this->assignRef('end', $end);
        $this->assignRef('from_dest', $from_dest);
        $this->assignRef('to_dest', $to_dest);
        $this->assignRef('lat_long_from', $lat_long_from);
        $this->assignRef('lat_long_to', $lat_long_to);
        $this->assignRef('dist_miles', $dist_miles);
        $this->assignRef('price', $price);
        $this->assignRef('formatted_price', $formatted_price);
        $this->assignRef('returnjurney', $returnjurney);
        $this->assignRef('vehicletype', $vehicletype);
        $this->assignRef('selpsg', $selpsg);
        $this->assignRef('suitcases', $suitcases);
        $this->assignRef('infantseats', $infantseats);
        $this->assignRef('chseats', $chseats);
        $this->assignRef('boosterseats', $boosterseats);
        $this->assignRef('selcarry', $selcarry);

        parent::display($tpl);
    }

}

?>